<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('修改律师信息')" />
    <th:block th:include="include :: datetimepicker-css" />
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
    <form class="form-horizontal m" id="form-user-edit" th:object="${crUser}">
        <input name="userId" th:field="*{userId}" type="hidden">
        <div class="form-group">
            <label class="col-sm-3 control-label">登录账号：</label>
            <div class="col-sm-8">
                <input name="loginId" th:field="*{loginId}" class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">密码：</label>
            <div class="col-sm-8">
                <input name="password" th:field="*{password}" class="form-control" type="text">
            </div>
        </div>
<!--        <div class="form-group">-->
<!--            <label class="col-sm-3 control-label">用户类型，0个人，1,律师，2机构：</label>-->
<!--            <div class="col-sm-8">-->
<!--                <select name="userType" class="form-control m-b" th:with="type=${@dict.getType('user_type')}">-->
<!--                    <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{userType}"></option>-->
<!--                </select>-->
<!--            </div>-->
<!--        </div>-->
        <div class="form-group">
            <label class="col-sm-3 control-label">名称：</label>
            <div class="col-sm-8">
                <input name="userName" th:field="*{userName}" class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">身份证号码：</label>
            <div class="col-sm-8">
                <input name="idCard" th:field="*{idCard}" class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">地址：</label>
            <div class="col-sm-8">
                <input name="address" th:field="*{address}" class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">手机号：</label>
            <div class="col-sm-8">
                <input name="mobile" th:field="*{mobile}" class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">邮箱：</label>
            <div class="col-sm-8">
                <input name="email" th:field="*{email}" class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">律师执业证件号：</label>
            <div class="col-sm-8">
                <input name="lawyerCertificateNo" th:field="*{lawyerCertificateNo}" class="form-control" type="text">
            </div>
        </div>
<!--        <div class="form-group">-->
<!--            <label class="col-sm-3 control-label">社会统一信用代码&#45;&#45;律所：</label>-->
<!--            <div class="col-sm-8">-->
<!--                <input name="socialUnifiedCreditCode" th:field="*{socialUnifiedCreditCode}" class="form-control" type="text">-->
<!--            </div>-->
<!--        </div>-->
<!--        <div class="form-group">-->
<!--            <label class="col-sm-3 control-label">法定代表人&#45;&#45;律所：</label>-->
<!--            <div class="col-sm-8">-->
<!--                <input name="legalRepresentative" th:field="*{legalRepresentative}" class="form-control" type="text">-->
<!--            </div>-->
<!--        </div>-->
<!--        <div class="form-group">-->
<!--            <label class="col-sm-3 control-label">联系电话：</label>-->
<!--            <div class="col-sm-8">-->
<!--                <input name="fixedTelephone" th:field="*{fixedTelephone}" class="form-control" type="text">-->
<!--            </div>-->
<!--        </div>-->
        <div class="form-group">
            <label class="col-sm-3 control-label">所在律师事务所名称：</label>
            <div class="col-sm-8">
                <input name="lawFirmName" th:field="*{lawFirmName}" class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label"><span></span>头像：</label>
            <div class="col-sm-8">
                <input type="hidden" name="headPortrait" id="headPortrait" th:field="*{headPortrait}">
                <div class="layui-upload-drag" id="imgPathw">
                    <i class="layui-icon"></i>
                    <p><span style="color: red;">点击上传，或将图片拖拽到此处</span></p ><!--<span style="color: red;">图片尺寸:210*140</span>-->
                    <div class="layui-hide" id="imgPaths">
                        <hr>
                        <img src="" alt="上传成功后渲染" style="max-width: 196px">
                    </div>
                </div>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label"><span></span>身份证照片正面：</label>
            <div class="col-sm-8">
                <input type="hidden" name="idCardFacade" id="idCardFacade" th:field="*{idCardFacade}">
                <div class="layui-upload-drag" id="imgPathwidCardFacade">
                    <i class="layui-icon"></i>
                    <p><span style="color: red;">点击上传，或将图片拖拽到此处</span></p ><!--<span style="color: red;">图片尺寸:210*140</span>-->
                    <div class="layui-hide" id="imgPathsidCardFacade">
                        <hr>
                        <img src="" alt="上传成功后渲染" style="max-width: 196px">
                    </div>
                </div>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label"><span></span>身份证照片反面：</label>
            <div class="col-sm-8">
                <input type="hidden" name="idCardBack" id="idCardBack" th:field="*{idCardBack}">
                <div class="layui-upload-drag" id="imgPathwidCardBack">
                    <i class="layui-icon"></i>
                    <p><span style="color: red;">点击上传，或将图片拖拽到此处</span></p ><!--<span style="color: red;">图片尺寸:210*140</span>-->
                    <div class="layui-hide" id="imgPathsidCardBack">
                        <hr>
                        <img src="" alt="上传成功后渲染" style="max-width: 196px">
                    </div>
                </div>
            </div>
        </div>
<!--        <div class="form-group">-->
<!--            <label class="col-sm-3 control-label">营业执照照片：</label>-->
<!--            <div class="col-sm-8">-->
<!--                <input type="hidden" name="businessLicenseImage" th:field="*{businessLicenseImage}">-->
<!--                <div class="file-loading">-->
<!--                    <input class="form-control file-upload" id="businessLicenseImage" name="file" type="file">-->
<!--                </div>-->
<!--            </div>-->
<!--        </div>-->
        <div class="form-group">
            <label class="col-sm-3 control-label"><span></span>律师执业证书照片：</label>
            <div class="col-sm-8">
                <input type="hidden" name="lawyerCertificateImage" id="lawyerCertificateImage" th:field="*{lawyerCertificateImage}">
                <div class="layui-upload-drag" id="imgPathwlawyerCertificateImage">
                    <i class="layui-icon"></i>
                    <p><span style="color: red;">点击上传，或将图片拖拽到此处</span></p ><!--<span style="color: red;">图片尺寸:210*140</span>-->
                    <div class="layui-hide" id="imgPathslawyerCertificateImage">
                        <hr>
                        <img src="" alt="上传成功后渲染" style="max-width: 196px">
                    </div>
                </div>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">审核状态：</label>
            <div class="col-sm-8">
                <div class="radio-box" th:each="dict : ${@dict.getType('approval_status')}">
                    <input type="radio" th:id="${'auditStatus_' + dict.dictCode}" name="auditStatus" th:value="${dict.dictValue}" th:field="*{auditStatus}">
                    <label th:for="${'auditStatus_' + dict.dictCode}" th:text="${dict.dictLabel}"></label>
                </div>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">备注：</label>
            <div class="col-sm-8">
                <input name="remark" th:field="*{remark}" class="form-control" type="text">
            </div>
        </div>
    </form>
</div>
<th:block th:include="include :: footer" />
<th:block th:include="include :: datetimepicker-js" />
<script th:inline="javascript">
    var prefix = ctx + "business/user";
    $("#form-user-edit").validate({
        focusCleanup: true
    });

    function submitHandler() {
        if ($.validate.form()) {
            $.operate.save(prefix + "/edit", $('#form-user-edit').serialize());
        }
    }

    $("input[name='auditTime']").datetimepicker({
        format: "yyyy-mm-dd",
        minView: "month",
        autoclose: true
    });
    layui.use('upload',function() {
        var $ = layui.jquery, upload = layui.upload;
        upload.render({
            elem: '#imgPathw',
            url: ctx + 'common/upload',
            done: function(res){
                layer.msg(res.msg);
                if(res.code == 0){
                    layui.$('#imgPaths').removeClass('layui-hide').find('img').attr('src', res.url);
                    $('#headPortrait').val(res.url);
                }
            }
        });
    });
    layui.use('upload',function() {
        var $ = layui.jquery, upload = layui.upload;
        upload.render({
            elem: '#imgPathwidCardFacade',
            url: ctx + 'common/upload',
            done: function(res){
                layer.msg(res.msg);
                if(res.code == 0){
                    layui.$('#imgPathsidCardFacade').removeClass('layui-hide').find('img').attr('src', res.url);
                    $('#idCardFacade').val(res.url);
                }
            }
        });
    });
    layui.use('upload',function() {
        var $ = layui.jquery, upload = layui.upload;
        upload.render({
            elem: '#imgPathwidCardBack',
            url: ctx + 'common/upload',
            done: function(res){
                layer.msg(res.msg);
                if(res.code == 0){
                    layui.$('#imgPathsidCardBack').removeClass('layui-hide').find('img').attr('src', res.url);
                    $('#idCardBack').val(res.url);
                }
            }
        });
    });
    layui.use('upload',function() {
        var $ = layui.jquery, upload = layui.upload;
        upload.render({
            elem: '#imgPathwlawyerCertificateImage',
            url: ctx + 'common/upload',
            done: function(res){
                layer.msg(res.msg);
                if(res.code == 0){
                    layui.$('#imgPathslawyerCertificateImage').removeClass('layui-hide').find('img').attr('src', res.url);
                    $('#lawyerCertificateImage').val(res.url);
                }
            }
        });
    });
    $(function() {
        $('#imgPaths').removeClass('layui-hide').find('img').attr('src', [[${crUser.headPortrait}]]);
        $('#imgPathsidCardFacade').removeClass('layui-hide').find('img').attr('src', [[${crUser.idCardFacade}]]);
        $('#imgPathsidCardBack').removeClass('layui-hide').find('img').attr('src', [[${crUser.idCardBack}]]);
        $('#imgPathslawyerCertificateImage').removeClass('layui-hide').find('img').attr('src', [[${crUser.lawyerCertificateImage}]]);
    });
</script>
</body>
</html>